<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ include file="/common/taglibs.jsp" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>系统管理</title>
    <%@ include file="/common/util.jsp" %>
    <script type="text/javascript">
        function jumpPage(pageIndex) {
            window.location.href = "${cdnctx}/systemCollectAreaAir/collectAreaAirList.shtml?" + $.param($("#searchCollectAreaForm").serializeObject()) + "&pageIndex=" + pageIndex;
        }
        var obj = {
            addCollectArea: function () {
                window.location.href = "${cdnctx}/systemCollectAreaAir/collectAreaAirEdit.shtml";
            },
            updateCollectArea: function (collectAreaId, lightCode) {
                window.location.href = "${cdnctx}/systemCollectAreaAir/collectAreaAirEdit.shtml?collectAreaId=" + collectAreaId;
            },
            searchResert: function () {
            },
            deleteCollectArea: function (collectAreaid) {
                dialog_confirmled("确定删除吗？", function () {
                    window.location.href = "${cdnctx}/systemCollectAreaAir/deleteCollectArea.shtml?id=" + collectAreaid;
                });
            }
        };
        function sub() {
            var companycode = $("#companycode").val();
            if (!isNaN(companycode)&& companycode.length < 12) {
                console.log("表单提交");
                $("#airdevicestatusForm").submit();
            }
        }
    </script>
</head>
<body class="main">
<div class="-frame -style -luster" id="css_container">
    <!--首页框架页眉部分↓-->
    <%@ include file="/WEB-INF/pages/inc/header.jsp" %>
    <!--首页框架页眉部分↑-->

    <div class="content">

        <!-- Left导航菜单◎开始 -->
        <%@ include file="/WEB-INF/pages/inc/leftmenu.jsp" %>
        <!-- Left导航菜单◎结束 -->

        <div class="main-mid">
            <div class="pos"><img src="${cdnctx}/src/index/img/index.png"><a href="<%--${cdnctx}/system/systemMenu.shtml--%>">系统管理
                ></a><a href="${cdnctx}/systemCollectAreaAir/collectAreaAirList.shtml">空调采集区域管理</a></div>
            <div class="css_contentDiv">
                <form id="searchCollectAreaForm" action="${cdnctx}/systemCollectAreaAir/collectAreaAirList.shtml"
                      method="post">
                    <div class="searchArea" style="padding:10px;">
                        <label class="search_text"> 网关：</label>
                        <input id="searchGatewayID" name="gatewayid"
                               type="text" class="search_input" size="20" value="${collectArea.gatewayid}"
                                />
                        <label class="search_text"> 公司编码：</label>
                        <input id="companycode" name="companycode"
                               type="text" class="search_input" size="20" value="${collectArea.companycode}"
                                />
                        <input type="button" onclick="sub()" class="search_btn" value="查&nbsp;询"/>
                        <input type="reset" class="reset_btn" value="重&nbsp;置"/>
                        <input type="button" class="add_btn" value="新&nbsp;增" onclick="obj.addCollectArea()"/>
                    </div>
                </form>
                <div class="divTable">
                    <div class="detailDiv">
                        <table class="list_table">
                            <thead>
                            <tr>
                                <td>公司名</td>
                                <td>公司编码</td>
                                <td>网关</td>
                                <td>设备</td>
                                <td>通道</td>
                                <td>采集区域名</td>
                                <td>修改者</td>
                                <td>修改时间</td>
                                <td>备注</td>
                                <td>操作</td>
                            </tr>
                            </thead>
                            <c:if test="${empty(list) }">
                                <tr class="even" align="center" style="color:red">
                                    <td colspan="12" class="no-data" style="height: 300px;"></td>
                                </tr>
                            </c:if>
                            <c:if test="${not empty(list) }">
                                <c:forEach items="${list}" var="entity" varStatus="status">
                                    <tr>
                                        <td>${entity.customername}</td>
                                        <td>${entity.companycode}</td>
                                        <td>${entity.gatewayid}</td>
                                        <td>${entity.sensorid}</td>
                                        <td>${entity.channelid}</td>
                                        <td>${entity.collectareaname}</td>
                                        <td>${entity.modifyby}</td>
                                        <td>${entity.modifydate}</td>
                                        <td>${entity.memo}</td>
                                        <td>
                                            <input type='button' class='list_update_btn'
                                                   onclick='obj.updateCollectArea(${entity.id},"${entity.lightcode}")'
                                                   value='修改'/>
                                            <input type='button' class='list_delete_btn'
                                                   onclick='obj.deleteCollectArea(${entity.id})' value='删除'/>
                                        </td>
                                    </tr>
                                </c:forEach>
                            </c:if>
                        </table>
                    </div>
                    <c:if test="${not empty(list) }">
                        <div id="pageInfo" class="pageJump">
                            <script type="text/javascript">
                                pagination.getPaginationHtml('JavaScript:jumpPage({0})', ${pageIndex}, ${pageCount}, 'pageInfo');
                            </script>
                            <c:if test="${!empty(list) }">
                                共有${dataCount}条数据
                            </c:if>
                        </div>
                    </c:if>

                </div>
            </div>
        </div>

    </div>

    <!--首页框架页尾部分↓-->
    <%@ include file="/WEB-INF/pages/inc/footer.jsp" %>
    <!--首页框架页尾部分↑-->
</div>
</body>
</html>